//
//  TMWVKWebViewController.h
//  TMWebViewKitSDK
//
//  Created by rxk on 2020/7/15.
//  Copyright © 2020 Tianma. All rights reserved.
//

#import <TMSDK/TMSDK.h>
#import <WebKit/WebKit.h>
#import <TMWebViewKitSDK/TMWFullScreenWKWebview.h>



NS_ASSUME_NONNULL_BEGIN
typedef void (^TMWVKJBResponseCallback)(id responseData);
typedef void (^TMWVKJBHandler)(id data, TMWVKJBResponseCallback responseCallback);

@interface TMWVKWebViewController : TMViewController<WKNavigationDelegate>
@property (nonatomic, copy) void (^clickTravelButton)(void);
@property (nonatomic, strong) NSArray *userScriptArray;
@property (nonatomic, strong) TMWFullScreenWKWebview *tmWebView;
@property (nonatomic, strong, readonly) NSString *urlStr;
/**网页加载完成后是否自动隐藏加载动画, 默认为自动隐藏*/
@property (nonatomic, assign) BOOL tm_loadComplateAutoAnimated;
///是否是prsentDetail详情页面(视频详情页面有一个查看详情按钮，点击弹出网页链接)
@property (nonatomic, assign) BOOL isPrsentDetail;
/// 是否是专题， 是专题需要自行上报埋点
@property (nonatomic, assign) BOOL isSpecial;
/// 埋点需要的数据
@property (nonatomic, strong) TMStatistcalModel *staModel;

@property (nonatomic, strong) UIBarButtonItem *backItem;


/**是否允许使用缓存， 默认不允许*/
@property (nonatomic, assign) BOOL allowUseCache;
/// 阅读百分比（浙江埋点使用）
@property (nonatomic, copy) NSString * percent;

@property (nonatomic, copy) TMWVKJBResponseCallback callBackData;

- (void)tmwvk_registerHandler:(NSString*)handlerName handler:(TMWVKJBHandler)handler;
- (void)tmwvk_removeScriptMessageAll;
///webview返回根视图
- (void)webViewToRoot;
///重新加载页面
- (void)reloadWeb;

@end

NS_ASSUME_NONNULL_END
